#!/bin/csh

####################################################################
#
# vplusz deck
#
####################################################################

setenv NPICKS    2    
setenv IOFFSET1  0
setenv IOFFSET2  10
setenv SORT1     0.0
setenv SORT2     3000.0
setenv NSORT     10
setenv ISEED0    404
setenv ISEED1    404

setenv ALPHAMIN  -0.02
setenv ALPHAMAX  1.02

setenv NXRT      69
setenv NYRT      75
setenv NXRTBEG   1
setenv NXRTEND   69
setenv NYRTBEG   1
setenv NYRTEND   75

setenv IXDISP    41
setenv IYDISP    40

setenv PRECLT    16384

setenv AZIMUTH   0.0

setenv SGIWORKDIR0 .
setenv SGIWORKDIR1 .
setenv SGIOUTDIR .
setenv WORKDIR .

# INPUT files (if TOPC0=0 TOPC0MIGFILE will be used)
setenv TOPC0 0.0
setenv TOPC0MIGFILE $SGIWORKDIR0/c09.intpsm.grid

# INPUT files (if TOPCG0=0 TOPCG0MIGFILE will be used)
setenv TOPCG0 0.0
setenv TOPCG0MIGFILE $SGIWORKDIR0/dvz.intpsm.grid

# INPUT files (if TOPC0=1 TOPC0MIGFILE will be used)
setenv TOPC1 0.0
setenv TOPC1MIGFILE $SGIWORKDIR1/c0new+300.intpsm.grid

# INPUT files (if TOPC0=1 TOPC0MIGFILE will be used)
setenv TOPCG1 0.0
setenv TOPCG1MIGFILE $SGIWORKDIR1/dvz.intpsm.grid

setenv TOPZ0GRIDFILE $SGIWORKDIR0/WB1.sm.grid
setenv TOPZ1GRIDFILE $SGIWORKDIR1/WB1.sm.grid
setenv BASEC0MIGFILE $SGIWORKDIR0/ttvelsource.grid
setenv BASEC1MIGFILE $SGIWORKDIR1/ttvelsource.grid
setenv BASEZ0GRIDFILE $SGIWORKDIR0/top_salt17+.intpsm.grid
setenv BASEZ1GRIDFILE $SGIWORKDIR1/top_salt15+.intpsm.grid

setenv FNAME01 $SGIWORKDIR0/offset$IOFFSET1.intp.grid
setenv FNAME02 $SGIWORKDIR0/offset$IOFFSET2.intp.grid

setenv FNAME11 $SGIWORKDIR1/offset$IOFFSET1.intp.grid
setenv FNAME12 $SGIWORKDIR1/offset$IOFFSET2.intp.grid

# OUTPUT files
setenv CUPDATEFILE $SGIOUTDIR/c10.grid
setenv CTRC0FILE $SGIOUTDIR/ctrc0new10.grid
setenv ZUPDATEFILE $SGIOUTDIR/top_salt18.grid

#
echo 'Defination done'
#
/bin/rm -f CARDDATA
echo 'CARDDATA deleted'
#
cat > CARDDATA << EOF
This is the deck of pracmva
$NXRT            = nxrt
$NYRT            = nyrt
$NXRTBEG         = nxrtbeg
$NXRTEND         = nyrtend
$NYRTBEG         = nxrtbeg
$NYRTEND         = nyrtend
$IXDISP
$IYDISP
$ISEED0
$ISEED1
$NSORT
$SORT1
$SORT2
$NPICKS
$IOFFSET1
$IOFFSET2
'$FNAME01'
'$FNAME02'
'$FNAME11'
'$FNAME12'
$ALPHAMIN
$ALPHAMAX
0.0
'$TOPC0MIGFILE'
0.0
'$TOPC1MIGFILE'
0.0
'$TOPCG0MIGFILE'
0.0
'$TOPCG1MIGFILE'
'$BASEC0MIGFILE'
'$BASEC1MIGFILE'
'$TOPZ0GRIDFILE'
'$TOPZ1GRIDFILE'
'$BASEZ0GRIDFILE'
'$BASEZ1GRIDFILE'
'$CUPDATEFILE'
'$CTRC0FILE'
'$ZUPDATEFILE'
EOF
#
/bin/rm junk.parms
mv CARDDATA junk.parms
echo "*******************************************************************"
echo "*                       vplusz                                     "
echo "*******************************************************************"
#
vplusz < junk.parms
#
echo ""
echo " ********************************************* "
echo " *                                           * "
echo " *            CONGRATULATIONS!               * "
echo " *                                           * "
echo " ********************************************* "
echo ""
